<div class="box_item">
    <div class="cate-title">
        <img src="<?php echo $img_url; ?>style/images/img7.gif" width="14" height="15"  alt=""/> 
        <span>Rao vặt</span>
        <a href="/rao-vat" class="more">Xem thêm&nbsp;<img style="float: none" src="http://eximgate.vn/style/images/img3.png" alt="" border="0"></a>
    </div>
    <div class="cate-content">
        <?php
        if (isset($aADV) && count($aADV) > 0) {
            $size = count($aADV);
            $flag = $size < 5 ? 0 : ($size < 10 ? 1 : 2);
            $count = 0;
        ?>
        <div class="box-content-index">
        <?php
            $limit = $flag == 0 ? $size : 5;
            while($count < $limit){
            ?>
                <div class="cate-item">
                    <a href="<?php echo "/rao-vat/" . $aADV[$count]->url . "-" . $aADV[$count]->adv_id . ".html"; ?>">
                        <img src="<?php echo $img_url; ?>style/images/bullet1.png">
                        <?php echo $aADV[$count]->title; ?>
                    </a>
                </div>
            <?php
                $count++;
            }
        ?>
        </div>
        <div class="box-content-index">
        <?php
            $limit = $flag == 1 ? $size : 10;
            while($count < $limit && $flag != 0){
            ?>
                <div class="cate-item">
                    <a href="<?php echo "/rao-vat/" . $aADV[$count]->url . "-" . $aADV[$count]->adv_id . ".html"; ?>">
                        <img src="<?php echo $img_url; ?>style/images/bullet1.png">
                        <?php echo $aADV[$count]->title; ?>
                    </a>
                </div>
            <?php
                $count++;
            }
        ?>
        </div>
        <div class="clearfix"></div>
        <?php
        }
        else{
        ?>
            <div align='center' class='nodata'><?php echo $page_nodata; ?></div>
        <?php
        }
        ?>
    </div>           
</div>